#pragma once
#include "TypeDefs.h"

class color;
class vector3
{
public:
	vector3(void);
	vector3(const vector3 &a);
	//vector3(const color &colorA);
	vector3(float x, float y, float z);
	vector3(uint x, uint y, uint z);
	vector3(int x, int y, int z);
	~vector3(void);
	vector3 operator+=(const vector3 &b);
	vector3 operator-=(const vector3 &b);
	vector3 operator+(const vector3 &b) const;
	vector3 operator-(const vector3 &b) const;
	vector3 operator-() const;
	vector3 operator*(float a) const;
	vector3 operator/(float a) const;
	float Dot(const vector3 &b) const;
	vector3 Cross(const vector3 &b) const;
	vector3 Normalize() const;
	vector3 Negate() const;
	vector3 Rotate(float fX, float fY, float fZ) const;
	vector3 Rotate(const vector3 &rot) const { return Rotate(rot.x, rot.y, rot.z); };
	vector3 Rotate(const vector3 &rot) { return Rotate(rot.x, rot.y, rot.z); };
	vector3 MoveInDirection(const vector3 &movement, const vector3 &direction) const;
	bool IsZero() const;
	float Length() const;

	static vector3 Lerp(const vector3 &a, const vector3 &b, float step)
	{
		float sX = a.x + (b.x - a.x) * step;
		float sY = a.y + (b.y - a.y) * step;
		float sZ = a.z + (b.z - a.z) * step;
		return vector3(sX, sY, sZ);
	};

	float x;
	float y;
	float z;
};